﻿@model HxBlogs.WebApp.Models.EditViewModel
@{
    ViewBag.Title = "写文章";
}
@section styles{
    @Styles.Render("~/content/default")
    @Styles.Render("~/content/mdeditor")
}
<div class="blog-edit hx-container bg-white px-3">
    <form class="form-horizontal" role="form" action="/edit/save" method="post">
        <input type="hidden" name="MarkDown" value="@Model.MarkDown"  />
        <input type="hidden" name="HexId" value="@Model.HexId" />
        @{ 
            Html.RenderPartial("title", Model, new ViewDataDictionary()
            {
                {"Categories",ViewBag.Categories }
            }); 
        }
        <div class="form-row mb-2 hx-editor">
            <div class="col-md-12 col-sm-12">
                <div id="editor">
                    <textarea name="Content" class="d-none">@Model.Content</textarea>
                </div>
            </div>
        </div>
        @{
            Html.RenderPartial("blogtag",Model, new ViewDataDictionary()
            {
                {"Tags",ViewBag.Tags },
                {"PersonTags",ViewBag.PersonTags }
            });
        }
        @{
            Html.RenderPartial("blogtype", Model, new ViewDataDictionary()
            {
                {"Types",ViewBag.Types }
            });
        }
        <div class="form-row" hidden>
            <div class="col-sm-12">
                <button type="button" value="Y" class="btn btn-md btn-success btn-save">发布文章</button>
                <button type="button" value="N" class="btn btn-secondary btn-md btn-save" style="margin-left: .8rem;">保存草稿</button>
            </div>
        </div>
    </form>
</div>
@section scripts{
    @Scripts.Render("~/bundles/mdeditor")
}
